From: Florian Müllner Date: Mon, 19 Apr 2021 16:37:58 +0000 (+0200) Subject: dialog: Ensure action callback is called with no arguments X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~54 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=d8231413601e930a4435734160fc0f44869f3a3f;p=gnome-shell.git dialog: Ensure action callback is called with no arguments Using the callback directly as signal handler means that it will receive the signal parameters (in this case: the StButton instance that emits the signal). This leaks an implementation detail that is harmless in the best case, but can break dialogs when using bind() on the callback. Avoid that trap by explicitly calling the callback without arguments. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4139 Part-of: --- diff --git a/js/ui/dialog.js b/js/ui/dialog.js index 3e8bfee7d..9513a8151 100644 --- a/js/ui/dialog.js +++ b/js/ui/dialog.js @@ -133,7 +133,7 @@ class Dialog extends St.Widget { y_expand: true, label, }); - button.connect('clicked', action); + button.connect('clicked', () => action()); buttonInfo['button'] = button;